using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyClickToMove_Simple : MonoBehaviour
{
    public Camera mainCamera;
    public float speed;
    public EnemyMovement movement;

    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Vector3 mouseScreenPosition = Input.mousePosition;
            mouseScreenPosition.z = 10f;
            Vector3 worldPosition = mainCamera.ScreenToWorldPoint(mouseScreenPosition);
            movement.MoveTo(worldPosition, speed);
        }
    }

}